From 1cf8a44e39c5b21cfe67ddb61fe2b91b807443c6 Mon Sep 17 00:00:00 2001 From: "Liu, Jinsong" Date: Thu, 15 Dec 2011 10:58:53 +0100 Subject: [PATCH] x86/MCE: add more strict sanity check of one SRAR case When RIPV = EIPV = 0, it's a little bit tricky. It may be an asynchronic error, currently we have no way to precisely locate whether the error occur at guest or hypervisor. To avoid handling error in wrong way, we treat it as unrecovered. Signed-off-by: Liu, Jinsong Signed-off-by: Jan Beulich Committed-by: Jan Beulich --- xen/arch/x86/cpu/mcheck/mce_intel.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c index 1b941f41e3..0986025a8d 100644 --- a/xen/arch/x86/cpu/mcheck/mce_intel.c +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c @@ -375,8 +375,18 @@ static int mce_urgent_action(struct cpu_user_regs *regs, return 0; gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS); - /* Xen is not pre-emptible */ - if ( !(gstatus & MCG_STATUS_RIPV) && !guest_mode(regs)) + + /* + * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an + * asynchronic error, currently we have no way to precisely locate + * whether the error occur at guest or hypervisor. + * To avoid handling error in wrong way, we treat it as unrecovered. + * + * Another unrecovered case is RIPV = 0 while in hypervisor + * since Xen is not pre-emptible. + */ + if ( !(gstatus & MCG_STATUS_RIPV) && + (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) ) return -1; return mce_action(regs, mctc) == MCER_RESET ? -1 : 0; -- 2.30.2